<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class Block_Page_Head extends Core_Block {

	protected $_items = array();
	
	public function addJs($script) {
		$this->addItem('js', $script);
	}
	
	public function addCss($stylesheet) {
		$this->addItem('css', $stylesheet);
	}

	public function addItem($type, $src) {
		if (!isset($this->_items[$type])) $this->_items[$type] = array();
		array_push($this->_items[$type], App::url('skin/'.$src));
	}
	
	public function getItem($type) {
		return isset($this->_items[$type]) ? $this->_items[$type] : null;
	}
	
	public function getJs() {
		return $this->getItem('js');
	}
	
	public function getCss() {
		return $this->getItem('css');
	}
}
